package com.exsun.gateway.jt809.data;

import com.exsun.gateway.jt809.common.LinkType;
import io.netty.channel.Channel;

import java.util.Arrays;

public class PackageData {
	public PackageData(){
	}
	public PackageData(int msgId, byte[] msgBodyBytes, LinkType linkType){
		this.msgHeader = new MsgHeader(msgId);
		this.msgBodyBytes = msgBodyBytes;
		this.linkType = linkType;
	}
	/**
	 * 16byte 消息头
	 */
	protected MsgHeader msgHeader;

	// 消息体字节数组
	protected byte[] msgBodyBytes;

	/**
	 * 消息是否有效
	 */
	protected boolean isValid = false;

	private LinkType linkType;

	public MsgHeader getMsgHeader() {
		return msgHeader;
	}

	public void setMsgHeader(MsgHeader msgHeader) {
		this.msgHeader = msgHeader;
	}

	public byte[] getMsgBodyBytes() {
		return msgBodyBytes;
	}

	public void setMsgBodyBytes(byte[] msgBodyBytes) {
		this.msgBodyBytes = msgBodyBytes;
	}

	public LinkType getLinkType() {
		return linkType;
	}

	public void setLinkType(LinkType linkType) {
		this.linkType = linkType;
	}

	public boolean isValid() {
		return isValid;
	}

	public void setValid(boolean isValid) {
		this.isValid = isValid;
	}

	@Override
	public String toString() {
		return "PackageData [msgHeader=" + msgHeader + ", msgBodyBytes="
				+ Arrays.toString(msgBodyBytes) + "]";
	}



}
